﻿Imports System.Data.OleDb

Public Class Alumnos
    Inherits Datos


    Private _dniAlumno As String
    Public Property dniAlumno() As String
        Get
            Return _dniAlumno
        End Get
        Set(ByVal value As String)
            _dniAlumno = value
        End Set
    End Property


    Private _nombre As String
    Public Property nombre() As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property


    Private _fechaNac As String
    Public Property fechaNac() As String
        Get
            Return _fechaNac
        End Get
        Set(ByVal value As String)
            _fechaNac = value
        End Set
    End Property


    Private _email As String
    Public Property email() As String
        Get
            Return _email
        End Get
        Set(ByVal value As String)
            _email = value
        End Set
    End Property


    Private _domicilio As String
    Public Property domicilio() As String
        Get
            Return _domicilio
        End Get
        Set(ByVal value As String)
            _domicilio = value
        End Set
    End Property


    Private _estadoCivil As String
    Public Property estadoCivil() As String
        Get
            Return _estadoCivil
        End Get
        Set(ByVal value As String)
            _estadoCivil = value
        End Set
    End Property





    Public Function ObtenerAlumno() As DataSet
        Return Me.ObtenerSelect("obtenerAlumno", "Alumnos")
    End Function

    Public Sub InsertarInfoLaboral(ByVal dniAlumno As String _
                , ByVal nombreEmpresa As String, ByVal puesto As String _
                , ByVal funciones As String _
                , ByVal antiguedad As String)

        comando.CommandText = "insertInformacionLaboral"
        comando.Parameters.Add(New OleDbParameter("@paramDniAlumno", dniAlumno))
        comando.Parameters.Add(New OleDbParameter("@parameEmpresa", nombreEmpresa))
        comando.Parameters.Add(New OleDbParameter("@paramPuesto", puesto))
        comando.Parameters.Add(New OleDbParameter("@paramPrincipalesFunciones", funciones))
        comando.Parameters.Add(New OleDbParameter("@paramAntiguedad", antiguedad))

        Me.ejecutarComando()

    End Sub


    Public Function ObtenerVistaInfoLaboral() As DataSet
        Return Me.ObtenerSelect("obtenerVistaAlumnoInfoLaboral", "InfoLaboral")
    End Function


    Public Function ObtenerVistaInfoAcademica() As DataSet
        Return Me.ObtenerSelect("obtenerVistaAlumnoInfoAcademica", "AlumnoInfoAcademica")
    End Function

    Public Function ObtenerVistaInfoAcademica(ByVal dni As String) As DataSet
        Return Me.ObtenerSelect("obtenerAlumnoInfoAcademica", "AlumnoInfoAcademicadni", "@paramDni", dni)
    End Function

    Public Function ObtenerVistaInfoLaboral(ByVal dni As String) As DataSet
        Return Me.ObtenerSelect("obtenerAlumnoInfoLaboral", "AlumnoInfoLabraldni", "@paramDni", dni)
    End Function



    Public Sub InsertarInfoAcademica(ByVal dniAlumno As String _
            , ByVal NombreInstitucion As String, ByVal tituloPosgrado As String _
            , ByVal añoObtencion As String)

        comando.CommandText = "insertInformacionAcademica"
        comando.Parameters.Add(New OleDbParameter("@paramDniAlumno", dniAlumno))
        comando.Parameters.Add(New OleDbParameter("@paramNombreInstitucion", NombreInstitucion))
        comando.Parameters.Add(New OleDbParameter("@paramTituloPosgrado", tituloPosgrado))
        comando.Parameters.Add(New OleDbParameter("@paramAñoObtencion", añoObtencion))

        Me.ejecutarComando()
    End Sub


    Public Sub InsertarAlumno(ByVal dniAlumno As String _
             , ByVal Nombre As String, ByVal FechaNac As DateTime _
             , ByVal email As String _
             , ByVal domicilio As String _
             , ByVal estadoCivil As String)

        comando.CommandText = "insertAlumno"
        comando.Parameters.Add(New OleDbParameter("@paramDni", dniAlumno))
        comando.Parameters.Add(New OleDbParameter("@paramNombre", Nombre))
        comando.Parameters.Add(New OleDbParameter("@paramFechaNac", FechaNac))
        comando.Parameters.Add(New OleDbParameter("@paramEmail", email))
        comando.Parameters.Add(New OleDbParameter("@paramDomicilio", domicilio))
        comando.Parameters.Add(New OleDbParameter("@paramEstadoCivil", estadoCivil))

        Me.ejecutarComando()
    End Sub


    Public Sub insertarAlumno()

        comando.CommandText = "insertAlumno"
        comando.Parameters.Add(New OleDbParameter("@paramDni", me.dniAlumno))
        comando.Parameters.Add(New OleDbParameter("@paramNombre", Me.nombre))
        comando.Parameters.Add(New OleDbParameter("@paramFechaNac", Me.fechaNac))
        comando.Parameters.Add(New OleDbParameter("@paramEmail", Me.email))
        comando.Parameters.Add(New OleDbParameter("@paramDomicilio", Me.domicilio))
        comando.Parameters.Add(New OleDbParameter("@paramEstadoCivil", Me.estadoCivil))

        Me.ejecutarComando()
    End Sub

End Class
